using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Sys_Team -权限分组表 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class ISysTeam<T> :ModelBase<SysTeam> where T : SysTeam, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.TeamID = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return TeamID;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.TeamID=dy.TeamID;
           this.Title=dy.Title;
           this.TeamValue=dy.TeamValue;
           this.NewsValue=dy.NewsValue;
        } 

        #region 定义属性

     
         /// <summary>
        /// 组ID
        /// </summary>
        private int _TeamID =int.MinValue;
      
        /// <summary>
        /// 组ID
        /// </summary>
        public int TeamID
        {
            get 
            {
              return   (this._TeamID); 
            }

            set 
            {
                    _TeamID= value;  
            }
        }
       
     
         /// <summary>
        /// 名称
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 名称
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// 权限值
        /// </summary>
        private String _TeamValue = "";
      
        /// <summary>
        /// 权限值
        /// </summary>
        public String TeamValue
        {
            get 
            {
              return   (this._TeamValue); 
            }

            set 
            {
                    _TeamValue= value;  
            }
        }
       
     
         /// <summary>
        /// 新闻权限组
        /// </summary>
        private String _NewsValue = "";
      
        /// <summary>
        /// 新闻权限组
        /// </summary>
        public String NewsValue
        {
            get 
            {
              return   (this._NewsValue); 
            }

            set 
            {
                    _NewsValue= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(SysTeam info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["TeamID"]!= DBNull.Value)
                  {
                  info.TeamID=Convert.ToInt32(row["TeamID"]);
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["TeamValue"]!= DBNull.Value)
                  {
                  info.TeamValue=row["TeamValue"].ToString();
                 }
                 
                  
                  if(row["NewsValue"]!= DBNull.Value)
                  {
                  info.NewsValue=row["NewsValue"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, SysTeam info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@TeamID", DbType.Int32,ParameterTool.GetObj( info._TeamID )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@TeamValue", DbType.String,ParameterTool.GetObj( info._TeamValue )); 
            
             
                cn.AddInParameter(comm, "@NewsValue", DbType.String,ParameterTool.GetObj( info._NewsValue )); 
            
        } 

    } 
} 